package Tree.binTree.Test;

import static Tree.binTree.Test.BinaryTree.count;

public class BinaryTreeTest {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        binaryTree.createBinaryTree();

        /**
         * 1.前序遍历
         */
        System.out.print("前序遍历：");
        binaryTree.preOrder(binaryTree.root);
        System.out.println();
        /** 2.中序遍历 */
        System.out.print("中序遍历：");
        binaryTree.inOrder(binaryTree.root);
        System.out.println();
        /** 3.后序遍历 */
        System.out.print("后序遍历：");
        binaryTree.postOrder(binaryTree.root);
        System.out.println();
        /** 4.层次遍历 */
        System.out.print("层次遍历：");
        binaryTree.levelOrder(binaryTree.root);
        System.out.println();
        /** 5.获取节点个数1 */
        System.out.println("节点个数：" + count);
        binaryTree.getNodeCounts1(binaryTree.root);
        System.out.println(binaryTree.getCounts2(binaryTree.root));
    }
}
